package dr.joketalker.controller.view;

import android.content.Context;
import android.view.LayoutInflater;

import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.TextView;
import dr.joketalker.R;
import dr.joketalker.entity.Joke;


public class JokeView extends MyView{

	public JokeView(Context c,Joke joke) {
		super(c);
		LayoutInflater  mInflater = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	    mInflater.inflate(R.layout.joke_mini_view, this, true);
	    setJoke(joke);
	}
	
	
	public void setJoke(Joke joke) {
		TextView tvTitle = (TextView)this.findViewById(R.id.tvTitle);
		tvTitle.setText(joke.getTitle());
		
		TextView tvValue = (TextView)this.findViewById(R.id.tvValue);
		tvValue.setText(joke.getUser().getName());
		
		RatingBar rbRating = (RatingBar)this.findViewById(R.id.rbRating);
		rbRating.setRating(5);
		
	}
}
